﻿<div class="top-row ps-3 navbar navbar-dark">
    <div class="container-fluid">
        <a class="navbar-brand" href="">WMS</a>
        <button title="Navigation menu" class="navbar-toggler" @onclick="ToggleNavMenu">
            <span class="navbar-toggler-icon"></span>
        </button>
    </div>
</div>

<div class="@NavMenuCssClass nav-scrollable" @onclick="ToggleNavMenu">
    <nav class="flex-column">
        <div class="nav-item px-3">
            <NavLink class="nav-link" href="items" Match="NavLinkMatch.All">
                <span class="oi oi-tag" aria-hidden="true"></span> 物料管理
            </NavLink>
        </div>
        <div class="nav-item px-3">
            <NavLink class="nav-link" href="inventory">
                <span class="oi oi-layers" aria-hidden="true"></span> 库存管理
            </NavLink>
        </div>
        <div class="nav-item px-3">
            <NavLink class="nav-link" href="stockin-list">
                <span class="oi oi-action-redo" aria-hidden="true"></span> 入库管理
            </NavLink>
        </div>
        <div class="nav-item px-3">
            <NavLink class="nav-link" href="stockout-list">
                <span class="oi oi-action-undo" aria-hidden="true"></span> 出库管理
            </NavLink>
        </div>
        <div class="nav-item px-3">
            <NavLink class="nav-link" href="warehouses">
                <span class="oi oi-home" aria-hidden="true"></span> 仓库管理
            </NavLink>
        </div>
        <div class="nav-item px-3">
            <NavLink class="nav-link" href="locations">
                <span class="oi oi-map-marker" aria-hidden="true"></span> 库位管理
            </NavLink>
        </div>

    </nav>
</div>

@code {
    private bool collapseNavMenu = true;

    private string? NavMenuCssClass => collapseNavMenu ? "collapse" : null;

    private void ToggleNavMenu()
    {
        collapseNavMenu = !collapseNavMenu;
    }
}
